#include "../inc/client.h"

void *Receive_Online_Info(void *arg)
{
    int *cli_fd = (int *)arg;
    char buffer[1024];
    while (1)
    {
        memset(buffer, 0, sizeof(buffer));
        ssize_t recv_len = recv(*cli_fd, buffer, sizeof(buffer) - 1, 0);
        if (recv_len == -1)
        {
            perror("recv");
            break;
        }
        else if (recv_len == 0)
        {
            printf("服务器关闭连接\n");
            break;
        }
        else
        {
            printf("在线用户有:\n%s", buffer);
        }
    }
    return NULL;
}


